import {
	lazy
} from 'react';
import {Redirect} from 'react-router-dom';
import LoginOrRegister from '../components/LoginOrRegister/LoginOrRegister';
import Index from '../pages/Index/Index';
import Faxianmusic from '../components/Faxianmusic/Faxianmusic';
import Tuijiangedan from '../components/Tuijiangedan/Tuijiangedan';
import Zuixinmv from '../components/Zuixinmv/Zuixinmv';
import Zuixinsong from '../components/Zuixinsong/Zuixinsong';
import SearchList from '../components/SearchList/SearchList';
import Remengeshou from '../components/Remengeshou/Remengeshou';
import GedanDetail from '../components/GedanDetail/GedanDetail';
import MvDetail from '../components/MvDetail/MvDetail';
import My from '../components/My/My';
import News from '../components/News/News';
import SongComment from '../components/SongComment/SongComment';
import Routers from './Routers';
// const Tuijiangedan = lazy(() => import('../components/Tuijiangedan/Tuijiangedan'));
// const Zuixinmv = lazy(() => import('../components/Zuixinmv/Zuixinmv'));
// const Zuixinsong = lazy(() => import('../components/Zuixinsong/Zuixinsong'));
// const SearchList = lazy(() => import('../components/SearchList/SearchList'));
// const Remengeshou = lazy(() => import('../components/Remengeshou/Remengeshou'));
// const GedanDetail = lazy(() => import('../components/GedanDetail/GedanDetail'));
// const MvDetail = lazy(() => import('../components/MvDetail/MvDetail'));

var routesArr = [
{
	path:'/',
	exact: true,
	render: () => {
		return <Redirect to='/login'></Redirect>
	}
},
{
	path: '/login',
	component: LoginOrRegister
}, {
	path: '/index',
	component: Index,
	routes: [
		{
			path:'/index',
			exact: true,
			render: () => {
				return <Redirect to='/index/faxianmusic'></Redirect>		
			}
		},
		{
			path: '/index/faxianmusic',
			render: ()=>{
				return (<Routers components={Faxianmusic}></Routers>)
			}
		},
		{
			path: '/index/tuijiangedan',
			render: ()=>{
				return (<Routers components={Tuijiangedan}></Routers>)
			}
		},
		{
			path: '/index/zuixinmv',
			render: ()=>{
				return (<Routers components={Zuixinmv}></Routers>)
			}
		},
		{
			path: '/index/zuixinsong',
			render: ()=>{
				return (<Routers components={Zuixinsong}></Routers>)
			}
		},
		{
			path: '/index/search',
			render: (route)=>{
				return (<Routers key={route.location.search} components={SearchList}></Routers>)
			}
		},
		{
			path: '/index/remengeshou',
			render: ()=>{
				return (<Routers components={Remengeshou}></Routers>)
			}
		},
		{
			path:'/index/my',
			render: ()=>{
				return (<Routers components={My}></Routers>)
			}
		},
		{
			path: '/index/mvdetail',
			render: ()=>{
				return (<Routers components={MvDetail}></Routers>)
			}
		},
		{
			path: '/index/gedandetail',
			render: ()=>{
				return (<Routers components={GedanDetail}></Routers>)
			}
		},
		{
			path: '/index/news',
			render: ()=>{
				return (<Routers components={News}></Routers>)
			}
		},
		{
			path: '/index/songComment',
			render: ()=>{
				return (<Routers components={SongComment}></Routers>)
			}
		}
	]
}]

export default routesArr;